#ifndef __RING_BUFF_H
#define __RING_BUFF_H
#include "stm32f0xx.h"

#define RINGBUFF_LEN    100
#define FALSE    1
#define TRUE     0
#define END_FLAG    '\n'
	
typedef struct
{
   uint8_t Head;
   uint8_t Tail;
   uint8_t Length;
	 uint8_t Ring_Buff[RINGBUFF_LEN];
}RingBuff_t;

void RingBuff_Init(void);
uint8_t Write_RingBuff(uint8_t data);
uint8_t Read_RingBuff(uint8_t *rData);
uint8_t Get_CanWrite_length(void);
uint8_t Write_Cmd(uint8_t* cmd, uint8_t len);
uint8_t Read_Cmd(uint8_t *cmd);
uint8_t Get_RingBuff_Length(void);

#endif
